<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>
		</title>
		<meta name="viewport" content="width=1000, initial-scale=1.0, maximum-scale=1.0">
		<!-- Loading Bootstrap -->
		<link href="Public/Flat/dist/css/vendor/bootstrap.min.css" rel="stylesheet">
		<!-- Loading Flat UI -->
		<link href="Public/Flat/dist/css/flat-ui.css" rel="stylesheet">
		<link href="Public/Flat/docs/assets/css/demo.css" rel="stylesheet">
		<link rel="shortcut icon" href="Public/Flat/img/favicon.ico">
		<!-- HTML5 shim, for IE6-8 support of HTML5 elements. All other JS at the end of file. -->
		<!--[if lt IE 9]>
		<script src="dist/js/vendor/html5shiv.js"></script>
		<script src="dist/js/vendor/respond.min.js"></script>
		<![endif]-->
	</head>
	<body>
		<form action="" method="post" enctype="multipart/form-data">
			<div class="alert alert-success">
				添加文章
			</div>
			<div class="form-group">
				<label for="exampleInputEmail1">文章标题</label>
				<input id="exampleInputEmail1" class="form-control" type="text" placeholder="请输入分类名称" name="title" value="<?php echo $olddata['title']?>">
			</div>
			<div class="form-group">
				<label for="exampleInputEmail1">作者</label>
				<input id="exampleInputEmail1" class="form-control" type="text" placeholder="请输入分类名称"  name="author" value="<?php echo $olddata['author']?>">
			</div>
			<div class="form-group">
				<label for="exampleInputEmail1">所属分类</label>
				<select name="category_cid" class="form-control">
					<option value="0">
						请选择
					</option>
					<?php foreach ($TnameAll as $k=>$v){?>
						<option value="<?php echo $v['cid']?>"<?php if($v['cid']==$Cid){?>
                selected
               <?php }?>><?php echo $v['_cname']?></option>
					<?php }?>
				</select>
			</div>
			<script type="text/javascript" src="./Public/jquery-1.8.2.min.js"></script>
			<script type="text/javascript" >
				$(function(){
					$(".close_img").click(function(){
						$(".img_div").remove();
						$(".file_div").html('<input id="exampleInputEmail1" type="file" name="thumb">');
					})
				})
			</script>
			<div class="form-group">
				<label for="exampleInputEmail1">缩略图</label>
				<?php if($olddata['thumb']){?>
                
					<div class="img_div">
						<img src="<?php echo $olddata['thumb']?>"/>
						<input type="hidden" name="thumb" id="thumb" value="<?php echo $olddata['thumb']?>" />
						<a class="close_img">
							X关闭
						</a>
					</div>
				<?php }else{?>
					<input id="exampleInputEmail1" type="file" name="thumb">
				
               <?php }?>
				<div class="file_div">
					
				</div>
				<!--<input id="exampleInputEmail1" type="file" name="thumb">-->
			</div>
			<div id="">
				<label for="">文章标签</label>
				<br />
				<?php foreach ($tagData as $k=>$v){?>
				<label class="checkbox checkbox-inline">
					<input  class="custom-checkbox" type="checkbox" data-toggle="checkbox" value="<?php echo $v['tid']?>"  name="tag_tid[]" <?php if(in_array($v['tid'], $Tid)){?>
                checked="checked"
               <?php }?>>
					<span class="icons">
						<span class="icon-unchecked">
						</span>
						<span class="icon-checked">
						</span>
					</span>
					<?php echo $v['tname']?>
				</label>
				<?php }?>
			</div>
			<div class="form-group">
				<label for="exampleInputEmail1">文章摘要</label>
				<textarea name="digest" rows="5" cols=""  class="form-control" placeholder="请输入文章关键字"><?php echo $olddata['author']?></textarea>				

			</div>
			<div class="form-group">
				<label for="exampleInputEmail1">文章关键字</label>
				<textarea name="keywords" rows="5" cols=""  class="form-control" placeholder="请输入文章关键字"><?php echo $olddata['keywords']?></textarea>				

			</div>
			<div class="form-group">
				<label for="exampleInputEmail1">文章描述</label>
				<textarea name="des" rows="5" cols=""  class="form-control" placeholder="请输入文章描述"><?php echo $content["des"]?></textarea>				

			</div>
			<!--编辑器-->
			<script type="text/javascript" src="Public/ueditor1_4_3/ueditor.config.js"></script>
			<script type="text/javascript" src="Public/ueditor1_4_3/ueditor.all.min.js"></script>
			<script type="text/javascript" src="Public/ueditor1_4_3/lang/zh-cn/zh-cn.js"></script>
			
			<div class="form-group">
				<label for="exampleInputEmail1">文章正文</label>
				<script id="editor" type="text/javascript" name="content" style="width: 100%;height: 200px;"><?php echo $content['content']?></script>
				<script type="text/javascript">
					var ue = UE.getEditor("editor");
					
				</script>	
				
			</div>
			<input type="hidden" name="aid" id="aid" value="<?php echo $_GET['aid']?>" />
			
			<button class="btn btn-primary btn-block" type="submit">
				确定
			</button>
		</form>
		
	</body>
</html>
